#define _CRT_SECURE_NO_WARNINGS 1

#include <iostream>
#include <vector>
#include <algorithm>
#include <set>
#include <unordered_map>
#include <string>
#include <queue>
#include <stack>
#include <map>
#include <list>

#define endl '\n'

using namespace std;

typedef long long ll;

typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef pair<string, string> pss;
typedef pair<string, int> psi;

typedef vector<bool> vb;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef vector<string> vs;
typedef vector<pii> vpii;
typedef vector<pll> vpll;
typedef vector<pss> vpss;
typedef vector<vi> vvi;

typedef queue <int> qi;
typedef queue <ll> ql;
typedef queue <pii> qpii;
typedef queue <psi> qpsi;

typedef priority_queue<int> pqi;
typedef priority_queue<string> pqs;
typedef priority_queue<pii> pqpii;
typedef priority_queue<psi> pqpsi;

typedef unordered_map<int, int> umapii;
typedef unordered_map<string, int> umapsi;

const int N = 1e5 + 5;
int t = 1;
int i;

void solve()
{
	int n; 
	cin >> n;
	vl nums(n);
	for (int i = 0; i < n; i++)
	{
		cin >> nums[i];
	}
	for (ll i = 0; i < 61; i++)
	{
		unordered_map<ll, ll> cnt;
		ll k = pow((ll)2, (ll)i);
		for (int i = 0; i < n; i++)
		{
			cnt[nums[i] % k]++;
		}
		if (cnt.size() == 2)
		{
			cout<< k << endl;
			return;
		}
	}
}

int main()
{
	ios::sync_with_stdio(false), cin.tie(nullptr), cout.tie(nullptr);
	cin >> t;
	i = t;
	while (t--)
	{
		solve();
	}
	return 0;
}